//******************************************************************************
//	: 		nlcd_Char(char c, unsigned char x, unsigned char y, int fColor, int bColor)  	 
// 	:       x,y,  fcolor,   bcolor   	 
//	:  x:        0-131
//			    y:        0-131
//         fcolor:        (12-bit . #define)
//         bcolor:        (12-bit . #define)     
//  :	
//******************************************************************************  

void nlcd_Char(char c, unsigned char x, unsigned char y, int fColor, int bColor) 
{ 
   int    i; 
   int    j; 
   unsigned int    nCols; 
   unsigned int    nRows; 
   unsigned int    nBytes; 
   unsigned char   PixelRow; 
   unsigned char   Mask; 
   unsigned int    Word0;
   unsigned char   *pFont;  
   unsigned char   *pChar;
   
   if (c>127) c=c-64; 	             //      
						             //   (   0x80).   Chipper-   !
   
   pFont = (unsigned char *)Nokia6610_fnt8x8;   
 
   nCols = pgm_read_byte(pFont); 
 
   nRows = pgm_read_byte(pFont + 1); 
 
   nBytes = pgm_read_byte(pFont + 2); 
   
   pChar = pFont + (nBytes * (c - 0x1F)); 
 
   for (i = 0; i<nCols; i++)
   {  
      PixelRow = pgm_read_byte(pChar++); 
      Mask = 0x80; 
      for (j = 0; j < nRows; j += 1) 
	  { 
         if ((PixelRow & Mask) == 0) 
         Word0 = bColor; 
         else 
         Word0 = fColor; 
         nlcd_Pixel( x-j,y+i, Word0);
         Mask = Mask >> 1; 
      }   
   } 
   nlcd_SendByte(CMD_LCD_MODE,LCD_PHILLIPS_NOP);  
} 

//******************************************************************************
//	: 		nlcd_Text(char *ptext, unsigned char x, unsigned char  y,  int fColor, int bColor)  	 
// 	:       x, y,  fColor,   bColor	 
//	:  x:        0-131
//			    y:        0-131
//              fColor:   (12-bit . #define)
//              bColor:   (12-bit . #define)
//  :		nlcd_Text("Hello",40,12,WHITE,BLACK);
//****************************************************************************** 
void nlcd_Text(char *ptext, unsigned char x, unsigned char  y,  int fColor, int bColor) 
{ 
   while (*ptext != 0x00) 
   { 
      nlcd_Char(*ptext++, x, y, fColor, bColor); 
      y=y+8;
      if (x > 131) break; 
   } 
} 